﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ManagerAccount : System.Web.UI.Page
{
    PIMService pimService = new PIMService();
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {

            if (Request["u"] != null)
            {
                try
                {
                    string userid = Crypto.Decrypt(Request["u"]);
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "error", "window.onload = LoadUser('" + userid + "');changepass('" + userid + "');", true);
                }
                catch (Exception ex)
                {

                }
            }

            else
            {
                if (Session["Userid"] == null)
                {
                    Response.Redirect("index.aspx");
                }
                string userid = Session["Userid"].ToString();
                ScriptManager.RegisterStartupScript(this, typeof(Page), "error", "window.onload = LoadUser(" + userid + ");changepass('" + userid + "');", true);
                //ScriptManager.RegisterStartupScript(this, typeof(Page), "error", "window.onload = changepass('" + userid + "');", true);
            }
        }
        
    }
    protected void btnChangePass_Click(object sender, EventArgs e)
    {
        //if (Request["u"] != null)
        //{
        //    pimService.ChangePassword(
        //    }
    }
}